﻿using DomainEventDemo.OrderLogs;
using DomainEventDemo.Orders;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;

namespace DomainEventDemo.EntityFrameworkCore
{
    public static class OrderingDomainEventDemoDbContextModelCreatingExtensions
    {
        public static void ConfigureDomainEventDemo(this ModelBuilder builder)
        {
            Check.NotNull(builder, nameof(builder));

            builder.Entity<Order>(b =>
            {
                b.ToTable("Orders");
                b.ConfigureByConvention();
            });

            builder.Entity<OrderLog>(b =>
            {
                b.ToTable("OrderLogs");
                b.ConfigureByConvention();
            });
        }
    }
}